module.exports = function(grunt){

  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    connect: {
      options: {
        port: 9000,
        hostname: '*',
        livereload: 35730
      },

      server: {
        options: {
          open: true,
          base: [
            'app'
          ]
        }
      }
    },

    babel: {
      options: {
        sourceMap: true
      },
      dist: {
        files: {
          "dist/app.js": "src/app.js"
        }
      }
    },

    watch: {
      livereload: {
        options: {
          livereload: '<%=connect.options.livereload%>'
        },

        files: [
          'app/*.html',
          'app/css/{,*/}*.css',
          'app/js/{,*/}*.js',
          'app/js/{,*/}*.html',
          'app/img/{,*/}*.{png,jpg,gif}'
        ]
      }
    }
  });

  grunt.registerTask('serve', ['connect:server', 'watch']);
}